package com.bigflexlib.x.flash.geom.Rectangle
{
	import com.bigflexlib.x.flash.geom.GeomTestBase;
	
	import flash.geom.Rectangle;
	



	public class RectangleUtilTest extends GeomTestBase
	{



		public function test_getSmallestScaleToFitAIntoB( ):void
		{
		
			var r100_100:Rectangle = new Rectangle( 0, 0, 100, 100 );
			var r100_200:Rectangle = new Rectangle( 0, 0, 100, 200 );
			var r200_100:Rectangle = new Rectangle( 0, 0, 200, 100 );
			var r200_200:Rectangle = new Rectangle( 0, 0, 200, 200 );


			
			ssfab( r100_100, r100_100, 1 );		
			ssfab( r100_100, r100_200, 1 );		
			ssfab( r100_100, r200_100, 1 );		
		

			ssfab( r100_100, r200_200, 2 );		
			
			ssfab( r100_200, r200_200, 1 );		
			

			ssfab( r200_200, r100_100, 0.5 );		

			ssfab( r200_200, r100_200, 0.5 );		
			ssfab( r200_200, r200_100, 0.5 );		
			ssfab( r200_200, r100_100, 0.5 );		
			
		
		
		}



		private function ssfab( a:Rectangle, b:Rectangle, scale:Number ):void
		{
			assertEquals( 
					RectangleUtil.getSmallestScaleToFitAIntoB( a, b ),
					scale				
				);				
		}

		
	}

}